package ia;


public class DistanciaEuclidea90 implements Heuristica{
    private static DistanciaEuclidea90 instancia = new DistanciaEuclidea90();

    private DistanciaEuclidea90(){}

    public static DistanciaEuclidea90 getInstance(){
        return instancia;
    }

    @Override
    public float calculaHeuristica(Nodo n, int[] posGertru) {
    	float dHorizontal,dVertical;    	
        dHorizontal = n.getX() - posGertru[0];
        dVertical   = n.getY() - posGertru[1];
        
        return (float) Math.sqrt(dHorizontal*dHorizontal+dVertical*dVertical);
    }
}
